# _*_ coding utf-8 _*_
# george
# time: 2025/1/3下午2:43
# name: request_test.py
# comment:
import requests

user = "F7692281"
passwd = "shaibi521..."

header = {
    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
}

# 指定代理,不指定代理,无法上网
proxies = {
    "http": f"http://{user}:{passwd}@10.191.131.21:3128",
    "https": f"http://{user}:{passwd}@10.191.131.21:3128"
}
url = "https://www.baidu.com/"
response = requests.get(url=url, json={"zz": "test"},proxies=proxies)
if response.status_code == 200:
    try:
        data = response.text
        print(data)
    except ValueError as e:
        print("Error parsing JSON:", e)
else:
    print("Request failed with status code:", response.status_code)
    with open("./1.html", mode="w", encoding="utf-8") as f:
        f.write(response.text)
